<form id="reportform" name="reportform" method="post" action="">
    <div id="rheaders">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">            
            <tr>
                <td id="datoscuenta"><table width="100%" border="0" cellspacing="0" cellpadding="2">
                        <tr>
                            <td width="15%">Tipo</td>
                            <td width="85%"><p>
                                    <label>
                                        <input type="radio" name="tipoconsulta" checked value="ESTUDIANTE" id="tipoconsulta_0" />
                                        Estudiante
                                    </label>
                                    <br />
                                    <label>
                                        <input type="radio" name="tipoconsulta" value="BENEFACTOR" id="tipoconsulta_1" />
                                        Benefactor
                                    </label>
                                    <br />
                                    <label>
                                        <input type="radio" name="tipoconsulta" value="3" id="tipoconsulta_2" />
                                        Todos</label>
                                    <br />
                                </p></td>
                        </tr>
                        <tr>
                            <td><label for="codigo"> Codigo</label></td>
                            <td><input size="80" type="text" name="codigo" id="codigo" />
                                <input size="80" type="hidden" name="hdnCodigo" id="hdnCodigo" />
                            </td>
                        </tr>                        
                        <tr>
                            <td><label for="codigo"> Rango Fechas</label></td>
                            <td><input size="15" type="text" name="fini" id="fini" />&nbsp;
                                <input size="15" type="text" name="fini" id="ffin" />&nbsp;
                            </td>
                        </tr>    
                        <tr>
                            <td><label for="codigo"> Estado Cobro</label></td>
                            <td><select id="estado" name="estado">
                                    <option value="">Todos</option>
                                    <option value="">COBRADO</option>
                                    <option value="">ANULADO</option>
                                    <option value="">CERRADO</option>
                                </select>
                            </td>
                        </tr> 
                    </table></td>
            </tr>
        </table>
        <script type="text/javascript">
            $("#fini").datepicker({changeYear:true,yearRange: 'c-50:c',dateFormat:'dd/mm/yy'});
            $("#ffin").datepicker({changeYear:true,yearRange: 'c-50:c',dateFormat:'dd/mm/yy'});
            $("#tipoconsulta_3").click(function(){
                $("#codigo").attr("readonly",$(this).attr("checked"));
            });
            var opsauto={
                source: app.ajaxRequestPath+"&report=listalumnos",
                minLength: 1,
                select: function( event, ui ) {
                    $("#hdnCodigo").val(ui.item.id);                    
                    $("#nombrecuenta").val(ui.item.value);
                    doReportReq();
                }
            };
            $("#codigo").autocomplete(opsauto);
            $("input[name*=tipoconsulta]").click(function(){
                if(this.value==1){
                    opsauto.source=app.ajaxRequestPath+"&report=listalumnos&"+$("#reportform").serialize();
                    $("#codigo").autocomplete(opsauto);
                }
                if(this.value==2){
                    opsauto.source=app.ajaxRequestPath+"&report=listbenef&"+$("#reportform").serialize();
                    $("#codigo").autocomplete(opsauto);
                }
            });
        </script>
    </div>
</form>